package cn.tradewin.advisor.components;

import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;

public class LayoutProject {

	@Property
    @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
    private String title;
	
	@Property
    private String pageName;
	
	@Inject
	private ComponentResources resources;
	
	@Inject
	Messages messages;
	
	public String[] getPageNames() {
		return new String[] {"project/board"};
	}
	
	public String getNaviCss() {
		 return resources.getPageName().equalsIgnoreCase(pageName) ? "active" : null;
	}
	
	public String getNaviLabel() {
		return messages.get(pageName);
	}
	
	/**
	 * 项目启动管理组
	 * @return
	 */
	public String[] getInits() {
		return new String[] {"project/init/CustomerBoard"};
	}
	
	/**
	 * 项目计划管理组
	 * @return
	 */
	public String[] getPlans() {
		return new String[] {"project/plan/TaskCategory", "project/plan/Resource", "project/plan/Risk", "project/plan/Delivery", "project/plan/WbsManagement"};
	}
	
	/**
	 * 项目执行过程组
	 * @return
	 */
	public String[] getExecutions() {
		return new String[] {"project/execution/QAManagement", "project/execution/CRManagement", "project/execution/BugManagement"};
	}
	
	/**
	 * 项目监控过程组
	 * 
	 * @return
	 */
	public String[] getMonitors() {
		return null;
	}
	
	/**
	 * 项目收尾过程组
	 * @return
	 */
	public String[] getEnds() {
		return null;
	}
}
